import { BasicColumn, FormSchema } from '/@/components/Table';
export const columns: BasicColumn[] = [
  {
    title: '采购编码',
    dataIndex: 'code',
  },
  {
    title: '商品名称',
    dataIndex: 'name',
  },
  {
    title: '商品来源',
    dataIndex: 'postRank_dictText',
  },
  {
    title: '商品规格',
    dataIndex: 'postRank_dictText',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: '职务名称',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '主键',
    field: 'id',
    component: 'Input',
    show: false,
  },
  {
    label: '职级',
    field: 'postRank',
    component: 'Input',
    required: true,
    componentProps: {
      dictCode: 'position_rank',
      dropdownStyle: {
        maxHeight: '100vh',
      },
      getPopupContainer: () => document.body,
    },
  },
  {
    field: 'name',
    label: '职务名称',
    component: 'Input',
    required: true,
  },
  {
    field: 'code',
    label: '职务编码',
    component: 'Input',
    required: true,
    dynamicDisabled: ({ values }) => {
      return !!values.id;
    },
  },
];
